//vue.config.js
const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()
module.exports = {
    transpileDependencies: ['@dcloudio/uni-ui', 'uview-ui'],
    // 开发模式反向代理配置，生产模式请使用Nginx部署并配置反向代理
    devServer: {
        port: 1889,
        proxy: {
            '/api': {
                // 本地服务接口地址
                target: 'http://192.168.3.210:80', // 仲献
                // target: 'http://192.168.3.233:80', // 晚星
                // target: 'http://10.76.135.249:10080',
                // target: 'https://saber.bladex.vip/api',
                ws: true,
                pathRewrite: {
                    '^/api': '/'
                }
            }
        }
    },
    configureWebpack: {
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'aliasPath']
					});
					return JSON.stringify(tfPages.routes)
				}, true )
			})
		]
	}
}